<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!-- saved from url=(0048)./OrderUserInfo.html -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>
    榆林科技馆内容页
</title>
    <link rel="stylesheet" type="text/css" href="/css/reset.css">
    <link rel="stylesheet" type="text/css" href="/css/main.css">
    <script type="text/javascript" src="./js/adddate.js"></script>
    <script type="text/javascript" src="/js/vue2.min.js"></script>
    <script type="text/javascript" src="/js/axios.min.js"></script>
    <script type="text/javascript" language="javascript">

        function isCardNo(card) {
            // 身份证号码为15位或者18位，15位时全为数字，18位前17位为数字，最后一位是校验位，可能为数字或字符X
            var cd = card.value;
            var reg = /(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/;
            if (reg.test(cd) === false) {
                card.value = "";
                alert("身份证输入不合法");
                return false;
            }
        }
    </script>
</head>
<body>
<form name="form1" method="post" action="./OrderUserInfo.html" id="form1">


    <script type="text/javascript">
        //<![CDATA[
        var theForm = document.forms['form1'];
        if (!theForm) {
            theForm = document.form1;
        }
        function __doPostBack(eventTarget, eventArgument) {
            if (!theForm.onsubmit || (theForm.onsubmit() != false)) {
                theForm.__EVENTTARGET.value = eventTarget;
                theForm.__EVENTARGUMENT.value = eventArgument;
                theForm.submit();
            }
        }
        //]]>
    </script>


    <div class="main_box">
        <div class="side_here">
            <p>
                <a href="./OrderUserInfo.html#" title="首页"></a>当前位置 &gt; <span>会员信息管理</span> &gt; <span>会员管理</span></p>
        </div>
        <div class="kong">
        </div>
        <!--公用位置导航结束-->
        <div id="person">
            <!--...-->
            <div class="cont_box">
                <p class="title_bt">
                    会员信息查询</p>
                <table class="table_list1" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr>
                        <td class="name">
                            姓名：
                        </td>
                        <td class="enter3">
                            <input name="txtUName" type="text" id="txtUName" class="input">
                        </td>
                        <td class="name">
                            身份证：
                        </td>
                        <td class="enter3">
                            <input name="txtUidentity" type="text" id="txtUidentity" onblur="isCardNo(this)" class="input">
                        </td>
                        <td class="name">
                            用户类型：
                        </td>
                        <td class="enter3">
                            <select name="ddlUtype" id="ddlUtype">
                                <option value="2">--请选择---</option>
                                <option value="0">个人用户</option>
                                <option value="1">团体用户</option>

                            </select>
                        </td>
                        <td>
                            <input type="submit" name="Button1" value="查询" id="Button1" class="chaxun">
                        </td>
                    </tr>
                    </tbody>
                </table>
            </div>
            <!--...-->
            <!--表格选项-->
            <div class="cont_box">
                <p class="title_bt">
                    会员信息列表</p>
                <table width="1060" border="0" cellpadding="0" cellspacing="0" class="table_list2">
                    <tbody><tr>
                        <th width="4%">
                            序号
                        </th>
                        <th width="7%">
                            姓名
                        </th>
                        <th width="15%">
                            身份证
                        </th>
                        <th width="8%">
                            电话
                        </th>
                        <th width="12%">
                            用户类型
                        </th>
                        <th width="12%">
                            团体名称
                        </th>
                        <th width="10%">
                            操作
                        </th>
                    </tr>

                    <tr v-for="p in per">
                        <td>
                            {{p.pid}}
                        </td>
                        <td>
                            {{p.pName}}
                        </td>
                        <td>
                            {{p.idCard}}
                        </td>
                        <td>
                            {{p.pTel}}
                        </td>
                        <td>
                            {{p.personType.ptName}}
                        </td>
                        <td>
                            {{p.organize}}
                        </td>
                        <td>
                            <input type="button" @click="updPerson(p.pid)" name="Repeater1$ctl00$btnEdit" value="" id="Repeater1_ctl00_btnEdit" title="编辑" class="btn btn_an btn_config">
                            <input type="button" @click="delPerson(p.pid)" name="Repeater1$ctl00$btndel" value="" id="Repeater1_ctl00_btndel" title="删除" class="btn btn_an btn_del">
                        </td>
                    </tr>
                    </tbody></table>
                <!--页码开始-->
                <div class="pages" style="margin-top: 40px;">
                    <ul class="yema">
                        <li style="border-left: none;">
                            <a id="Lbthead" class="pagebtn" href="javascript:__doPostBack(&#39;Lbthead&#39;,&#39;&#39;)">首页</a></li>
                        <li>
                            <a id="Lbtpre" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtpre&#39;,&#39;&#39;)">上一页</a></li>
                        <li>
                            <a id="Lbtnext" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtnext&#39;,&#39;&#39;)">下一页</a></li>
                        <li>
                            <a id="Lbtend" class="pagebtn" href="javascript:__doPostBack(&#39;Lbtend&#39;,&#39;&#39;)">尾页</a></li>
                        <div class="clear">
                        </div>
                    </ul>
                    <div class="searchPage">
                    <span class="page-sum">共<strong class="allPage">&nbsp;1
                    </strong>页</span>&nbsp;<span class="page-sum">第<strong class="allPage">&nbsp;1
                    </strong>页</span> <span class="page-go">跳转第
                        <input name="Txtpageno" type="text" id="Txtpageno" class="pagebtn" size="3" onkeyup="this.value=this.value.replace(/[^\d\.]/g, &#39;&#39;)" style="ime-mode: disabled">页</span>
                        <a id="BtngoPage" class="page-btn" href="javascript:__doPostBack(&#39;BtngoPage&#39;,&#39;&#39;)">GO</a>
                    </div>
                    <div class="clear">
                    </div>
                </div>
            </div>
            <!--...-->
        </div>
    </div>

</form>


<script>
    var person = new Vue({
        el:"#person",
        data:{
            per:[
                {"pid":1, "pName":"测试", "idCard":"1111", "pTel":"2222", "ptName":"团体用户", organize:"测试部"}
            ]
        },
        methods:{
            updPerson:function (id) {
                // alert(id);
                window.location.href = "/sys/PersonEdit.html?id=" + id;
            },
            delPerson:function (id) {
                var url = "/person?action=delPerson&id=" + id;
                var msg = window.confirm("是否确认删除？");
                if(msg) {
                    axios.get(url)
                        .then(res=>{
                            if(res.data == "success") {
                                for (var i = 0; i < person.per.length; i++) {
                                    if(id == person.per[i].pid) {
                                        person.per.splice(i,1);
                                    }
                                }
                            }
                        })
                }
            }
        }
    });
    window.onload = info;
    function info() {
        // alert("查询...");
        axios.get("/person?action=findAllPerson")
            .then(res=>{
                person.per = res.data;
            })
    }
</script>
</body></html>